import { ApiProperty } from "@nestjs/swagger";
import { IsString, Length } from "class-validator";

export class CreateQuestionDto {
    @ApiProperty({
        description: '题目内容',
        example: '这个世界上最高的山是哪座？',
        required: true,
    })
    @IsString()
    @Length(1, 255)
    question: string;

    @ApiProperty({
        description: '选项1',
        example: '珠穆朗玛峰',
        required: true,
    })
    @IsString()
    @Length(1, 255)
    option1: string;

    @ApiProperty({
        description: '选项2',
        example: '乔戈里峰',
        required: true,
    })
    @IsString()
    @Length(1, 255)
    option2: string;

    @ApiProperty({
        description: '选项3',
        example: '干城章嘉峰',
        required: true,
    })
    @IsString()
    @Length(1, 255)
    option3: string;

    @ApiProperty({
        description: '选项4',
        example: '洛子峰',
        required: true,
    })
    @IsString()
    @Length(1, 255)
    option4: string;

    @ApiProperty({
        description: '正确答案',
        example: '珠穆朗玛峰',
        required: true,
    })
    @IsString()
    @Length(1, 255)
    correctAnswer: string;
}
